﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SharePointOptimizer.Model;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using System.Management.Instrumentation;
using System.Management;
using System.Collections;
using System.Data.Sql;
using System.Runtime.InteropServices;
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
using SharePointOptimizer.SQLServer;
using SharePointOptimizer.BL.DataAnalysis;
using AG.Utilities;


namespace PlayGround
{
    public partial class Form1 : Form
    {
        //DataTable servers = SqlDataSourceEnumerator.Instance.GetDataSources();

        SharePointOptimizer.Model.SharePointOptimizerDataContext dc = new SharePointOptimizerDataContext();
        public Form1()
        {
            InitializeComponent();
        }

      
        private void button2_Click(object sender, System.EventArgs e)
        {
            Logger.Initialize(@"c:\");
            CollectSharePointFarmData collectcontent = new CollectSharePointFarmData();
            collectcontent.ClearAll();
             List<Exception> errors=   collectcontent.Collect();
             CollectSharePointContentData collectcontent2 = new CollectSharePointContentData();
            List<Exception> errors2 = collectcontent2.Collect();
             CheckSharePointFarmForIssues issues = new CheckSharePointFarmForIssues();

             issues.RunIssueChecks();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            string connstring = SPUsageApplicationProxy.Default.DatabaseConnectionString;
            XmlDocument doc = new XmlDocument();
            doc.Load("C:\\inetpub\\wwwroot\\wss\\VirtualDirectories\\80\\web.config");
            XmlNode node = doc.SelectSingleNode("/configuration/system.web/compilation");
            string debugvalue = node.Attributes.GetNamedItem("debug").Value;
            node = doc.SelectSingleNode("/configuration/SharePoint/BlobCache");
            string blobCacheEnabled = node.Attributes.GetNamedItem("enabled").Value;
            string blobCacheMaxSize = node.Attributes.GetNamedItem("maxSize").Value;
            node = doc.SelectSingleNode("configuration/SharePoint/ObjectCache");
            string objectCacheMaxSize = node.Attributes.GetNamedItem("maxSize").Value;
        }

        

    }

}

